﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CCH.DAO;

public partial class _1003 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            if (Request["sfu_type"] != null && Request["sfu_type"] != "")
            {
                sysfunctionDAO dao = new sysfunctionDAO();
                this.hidd_sfuNo.Value = dao.Get_pathNO(2001, Request["sfu_type"]).ToString();
                this.ObjectDataSource1.SelectParameters["sfu_no"].DefaultValue = this.hidd_sfuNo.Value;

                //標題名稱 <a href="">首頁</a><img src="css/tem/img/img-icon-4.jpg" width="5" height="7" />最新消息
                this.nav.InnerHtml = "";
                string imgStr = "<img src=\"css/tem/img/img-icon-4.jpg\" width=\"5\" height=\"7\" />";
                string[] sfu_name = dao.Get_titleName(int.Parse(this.hidd_sfuNo.Value)).Split('/');

                if (sfu_name[0].Trim() == sfu_name[1].Trim())
                {
                    this.nav.InnerHtml = string.Format("<a href=\"index.aspx\">" + "首頁".ConverToCN() + "</a>{0}<b>{1}</b>", imgStr, sfu_name[1].Trim()).ConverToCN();
                }
                else
                {
                    this.nav.InnerHtml = string.Format("<a href=\"index.aspx\">" + "首頁".ConverToCN() + "</a>{0}{1}{2}<b>{3}</b>", imgStr, sfu_name[0].Trim(), imgStr, sfu_name[1].Trim()).ConverToCN();
                }
                
                //this.lab_title2.Text = sfu_name[1].Trim();
            }

            this.GridView1.DataBind();
        }    
    }

    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        Response.Redirect("1003-1.aspx?mes_no=" + e.CommandName + "&sfu_no=" + this.hidd_sfuNo.Value);
    }

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            if (e.Row.RowIndex % 2 != 0)
            {
                e.Row.Cells[0].CssClass = "dotline-gary";
                e.Row.Cells[1].CssClass = "dotline-gary";
                e.Row.Cells[2].CssClass = "dotline-gary";
            }
        }
    }
}